//
//  ZConsultModel.m
//  DoctorFAQs
//
//  Created by zjq on 17/3/29.
//  Copyright © 2017年 zjq. All rights reserved.
//

#import "ZConsultModel.h"

@implementation ZConsultModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    // 防止多余Key
}

- (instancetype)initWithDict:(NSMutableDictionary *)dict {
    self = [super init];
    if (self) {
        self.qId = dict[@"id"];
        
        NSString * str = dict[@"time"];
        NSTimeInterval time = [str doubleValue];
        NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:time];
        NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
        [dateFormatter setDateFormat:@"YYYY-MM-dd hh:mm:ss"];
        NSString *currentDateStr = [dateFormatter stringFromDate: detaildate];
        //转化时间戳
        self.time = currentDateStr;
        [dict removeObjectForKey:@"id"];
        [dict removeObjectForKey:@"time"];
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
}

@end
